package execution;

import java.io.*;
import java.util.Scanner;

public class InOutProcess {
    private final static String OUTPUT_FILE_NAME = "pcoderesult.txt";
    private static OutputStreamWriter writer;
    private static Scanner input;

    public static void init() {
        FileOutputStream outputStream;
        try {
            outputStream = new FileOutputStream(OUTPUT_FILE_NAME);
            writer = new OutputStreamWriter(outputStream);
            input = new Scanner(System.in);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static Integer getInt() {
        try {
            return input.nextInt();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return 0;
    }

    public static void printf(String s) {
        try {
            writer.write(s);
            System.out.print(s);
            writer.flush();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
